{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Pokemon"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Introduction:\n",
    "\n",
    "This time you will create the data.\n",
    "\n",
    "\n",
    "\n",
    "### Step 1. Import the necessary libraries"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 2. Create a data dictionary"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "raw_data = {\"name\": ['Bulbasaur', 'Charmander','Squirtle','Caterpie'],\n",
    "            \"evolution\": ['Ivysaur','Charmeleon','Wartortle','Metapod'],\n",
    "            \"type\": ['grass', 'fire', 'water', 'bug'],\n",
    "            \"hp\": [45, 39, 44, 45],\n",
    "            \"pokedex\": ['yes', 'no','yes','no']                        \n",
    "            }"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 3. Assign it to a variable called pokemon"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>evolution</th>\n",
       "      <th>hp</th>\n",
       "      <th>name</th>\n",
       "      <th>pokedex</th>\n",
       "      <th>type</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Ivysaur</td>\n",
       "      <td>45</td>\n",
       "      <td>Bulbasaur</td>\n",
       "      <td>yes</td>\n",
       "      <td>grass</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Charmeleon</td>\n",
       "      <td>39</td>\n",
       "      <td>Charmander</td>\n",
       "      <td>no</td>\n",
       "      <td>fire</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Wartortle</td>\n",
       "      <td>44</td>\n",
       "      <td>Squirtle</td>\n",
       "      <td>yes</td>\n",
       "      <td>water</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Metapod</td>\n",
       "      <td>45</td>\n",
       "      <td>Caterpie</td>\n",
       "      <td>no</td>\n",
       "      <td>bug</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    evolution  hp        name pokedex   type\n",
       "0     Ivysaur  45   Bulbasaur     yes  grass\n",
       "1  Charmeleon  39  Charmander      no   fire\n",
       "2   Wartortle  44    Squirtle     yes  water\n",
       "3     Metapod  45    Caterpie      no    bug"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pokemon = pd.DataFrame(raw_data)\n",
    "pokemon.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 4. Ops...it seems the DataFrame columns are in alphabetical order. Place  the order of the columns as name, type, hp, evolution, pokedex"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>type</th>\n",
       "      <th>hp</th>\n",
       "      <th>evolution</th>\n",
       "      <th>pokedex</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Bulbasaur</td>\n",
       "      <td>grass</td>\n",
       "      <td>45</td>\n",
       "      <td>Ivysaur</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Charmander</td>\n",
       "      <td>fire</td>\n",
       "      <td>39</td>\n",
       "      <td>Charmeleon</td>\n",
       "      <td>no</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Squirtle</td>\n",
       "      <td>water</td>\n",
       "      <td>44</td>\n",
       "      <td>Wartortle</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Caterpie</td>\n",
       "      <td>bug</td>\n",
       "      <td>45</td>\n",
       "      <td>Metapod</td>\n",
       "      <td>no</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         name   type  hp   evolution pokedex\n",
       "0   Bulbasaur  grass  45     Ivysaur     yes\n",
       "1  Charmander   fire  39  Charmeleon      no\n",
       "2    Squirtle  water  44   Wartortle     yes\n",
       "3    Caterpie    bug  45     Metapod      no"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pokemon = pokemon[['name', 'type', 'hp', 'evolution','pokedex']]\n",
    "pokemon"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 5. Add another column called place, and insert what you have in mind."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>type</th>\n",
       "      <th>hp</th>\n",
       "      <th>evolution</th>\n",
       "      <th>pokedex</th>\n",
       "      <th>place</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Bulbasaur</td>\n",
       "      <td>grass</td>\n",
       "      <td>45</td>\n",
       "      <td>Ivysaur</td>\n",
       "      <td>yes</td>\n",
       "      <td>park</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Charmander</td>\n",
       "      <td>fire</td>\n",
       "      <td>39</td>\n",
       "      <td>Charmeleon</td>\n",
       "      <td>no</td>\n",
       "      <td>street</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Squirtle</td>\n",
       "      <td>water</td>\n",
       "      <td>44</td>\n",
       "      <td>Wartortle</td>\n",
       "      <td>yes</td>\n",
       "      <td>lake</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Caterpie</td>\n",
       "      <td>bug</td>\n",
       "      <td>45</td>\n",
       "      <td>Metapod</td>\n",
       "      <td>no</td>\n",
       "      <td>forest</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         name   type  hp   evolution pokedex   place\n",
       "0   Bulbasaur  grass  45     Ivysaur     yes    park\n",
       "1  Charmander   fire  39  Charmeleon      no  street\n",
       "2    Squirtle  water  44   Wartortle     yes    lake\n",
       "3    Caterpie    bug  45     Metapod      no  forest"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pokemon['place'] = ['park','street','lake','forest']\n",
    "pokemon"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 6. Present the type of each column"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "name         object\n",
       "type         object\n",
       "hp            int64\n",
       "evolution    object\n",
       "pokedex      object\n",
       "dtype: object"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pokemon.dtypes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### BONUS: Create your own question and answer it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
